/**
 * 删除博客
 */

const mdModel = require('../models/mdModel')

function del(body) {
  return new Promise((resolve, reject) => {
    mdModel.findOneAndUpdate({
      user_id: body.user_id
    }, {
      '$pull': {
        user_md: {
          title: body.title
        }
      }
    }, (err, suc) => {
      err? reject(err) : resolve(suc)
    })
  })
}

module.exports = {
  del
}